﻿@{
    ViewBag.title = "批量迁移文章";
    Admin my = Admin.GetMyInfo();
    List<int> aclist = new List<int>();
    if (my.Roles.IsSuperAdmin != 1 && !string.IsNullOrEmpty(my.Roles.AuthorizedArticleCagegory))
    {
        aclist = Newtonsoft.Json.JsonConvert.DeserializeObject<List<int>>(my.Roles.AuthorizedArticleCagegory);
    }
}
<div class="wrapper wrapper-content ">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>@ViewBag.Title</h5>
            <div class="ibox-tools">
            </div>
        </div>
        <div class="ibox-content">
            @using (Html.BeginForm(null, null, FormMethod.Post, new { id = "moveArticleForm", @class = "form-horizontal m-t" }))
            {
                <div class="alert alert-info">
                    注意：请务必确认迁移栏目文章，本操作不可逆，请慎重操作！
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">从本栏目：</label>
                    <div class="col-sm-8">
                        <select class="form-control m-b" name="from" id="from">
                            @foreach (var m in ViewBag.ListKinds)
                            {
                                if (my.Roles.IsSuperAdmin != 1)
                                {
                                    if (aclist.FindIndex(x => x == m.Id) > -1)
                                    {
                                        <option value="@m.Id">@m.KindName</option>
                                    }
                                }
                                else
                                {
                                    <option value="@m.Id">@m.KindName</option>
                                }
                            }
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">迁移至此栏目：</label>
                    <div class="col-sm-8">
                        <select class="form-control m-b" name="to" id="to">
                            @foreach (var m in ViewBag.ListKinds)
                            {
                                <option value="@m.Id">@m.KindName</option>
                            }
                        </select>
                    </div>
                </div>

                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <div class="col-sm-4 col-sm-offset-3">
                        <button class="btn btn-primary" type="submit"><i class="fa fa-save"></i> 提交 </button>
                        <button class="btn btn-default" type="button" onclick="closethisdialog();"><i class="fa fa-close"></i> 取消 </button>
                    </div>
                </div>
            }
        </div>
    </div>


</div>
<script>
    $(function () {
        DoPost("moveArticleForm");
    })

</script>